class LearningModule:
    def __init__(self, storage, ai_assistant):
        self.storage = storage
        self.ai_assistant = ai_assistant

    def create_learning_content(self, content, author):
        ai_result = self.ai_assistant.moderate_content(content)
        
        if ai_result['label'] == 'dangerous':
            return {"message": "内容被标记为危险"}, 400

        self.storage.insert_post(content, author)
        return {"message": "学习内容创建成功"}, 201